home *** CD-ROM | disk | FTP | other *** search
/ Programming a Multiplayer FPS in DirectX / Programming a Multiplayer FPS in DirectX (Companion CD).iso / DirectX / dxsdk_oct2004.exe / dxsdk.exe / Samples / C++ / Direct3D / DXTex / dxtex.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-09-27  |  2.8 KB  |  101 lines

  1. // dxtex.h : main header file for the DXTEX application
  2. //
  3.  
  4. #if !defined(AFX_DXTX_H__712C53C7_D63B_11D1_A8B5_00C04FC2DC22__INCLUDED_)
  5. #define AFX_DXTX_H__712C53C7_D63B_11D1_A8B5_00C04FC2DC22__INCLUDED_
  6.  
  7. #if _MSC_VER > 1000
  8. #pragma once
  9. #endif // _MSC_VER > 1000
  10.  
  11. #ifndef __AFXWIN_H__
  12.     #error include 'stdafx.h' before including this file for PCH
  13. #endif
  14.  
  15. #include "resource.h"       // main symbols
  16.  
  17. #ifndef ReleasePpo
  18.     #define ReleasePpo(ppo) \
  19.         if (*(ppo) != NULL) \
  20.         { \
  21.             (*(ppo))->Release(); \
  22.             *(ppo) = NULL; \
  23.         } \
  24.         else (VOID)0
  25. #endif
  26.  
  27. /////////////////////////////////////////////////////////////////////////////
  28. // CDxtexDocManager:
  29. // I override this class to customize DoPromptFileName to allow importing of
  30. // BMPs as well as DDSs into CDxtexDocs.
  31. //
  32. class CDxtexDocManager : public CDocManager
  33. {
  34. public:
  35.     virtual BOOL DoPromptFileName(CString& fileName, UINT nIDSTitle,
  36.             DWORD lFlags, BOOL bOpenFileDialog, CDocTemplate* pTemplate);
  37. };
  38.  
  39. /////////////////////////////////////////////////////////////////////////////
  40. // CDxtexCommandLineInfo:
  41. // I override this class to handle custom command-line options
  42. //
  43. class CDxtexCommandLineInfo : public CCommandLineInfo
  44. {
  45. public:
  46.     CString m_strFileNameAlpha;
  47.     CString m_strFileNameSave;
  48.     D3DFORMAT m_fmt;
  49.     BOOL m_bAlphaComing;
  50.     BOOL m_bMipMap;
  51.  
  52.     CDxtexCommandLineInfo::CDxtexCommandLineInfo(VOID);
  53.     virtual void ParseParam(const TCHAR* pszParam, BOOL bFlag, BOOL bLast);
  54.  
  55. };
  56.  
  57. /////////////////////////////////////////////////////////////////////////////
  58. // CDxtexApp:
  59. // See dxtex.cpp for the implementation of this class
  60. //
  61.  
  62. class CDxtexApp : public CWinApp
  63. {
  64. public:
  65.     CDxtexApp();
  66.     virtual ~CDxtexApp();
  67.     LPDIRECT3D9 Pd3d(VOID) { return m_pd3d; }
  68.     LPDIRECT3DDEVICE9 Pd3ddev(VOID) { return m_pd3ddev; }
  69.     BOOL HandlePossibleLostDevice(VOID);
  70.     VOID DeviceIsLost(VOID) { m_bDeviceLost = TRUE; }
  71.     HRESULT InvalidateDeviceObjects(VOID);
  72.     HRESULT RestoreDeviceObjects(VOID);
  73.  
  74. // Overrides
  75.     // ClassWizard generated virtual function overrides
  76.     //{{AFX_VIRTUAL(CDxtexApp)
  77.     public:
  78.     virtual BOOL InitInstance();
  79.     //}}AFX_VIRTUAL
  80.  
  81. // Implementation
  82.     //{{AFX_MSG(CDxtexApp)
  83.     afx_msg void OnAppAbout();
  84.         // NOTE - the ClassWizard will add and remove member functions here.
  85.         //    DO NOT EDIT what you see in these blocks of generated code !
  86.     //}}AFX_MSG
  87.     DECLARE_MESSAGE_MAP()
  88. private:
  89.     LPDIRECT3D9 m_pd3d;
  90.     LPDIRECT3DDEVICE9 m_pd3ddev;
  91.     BOOL m_bDeviceLost;
  92. };
  93.  
  94.  
  95. /////////////////////////////////////////////////////////////////////////////
  96.  
  97. //{{AFX_INSERT_LOCATION}}
  98. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  99.  
  100. #endif // !defined(AFX_DXTX_H__712C53C7_D63B_11D1_A8B5_00C04FC2DC22__INCLUDED_)
  101.